
			function createMap() {
				map = new BMap.Map("mapContainer");
				point = new BMap.Point(113.1781063661, 27.8358225823); // 创建点坐标  
				map.centerAndZoom(point, 11);
				var oval = new BMap.Polygon(add_oval(point, 0.1, 0.1), { strokeColor: "blue", strokeWeight: 6, strokeOpacity: 0.5 });
				map.addOverlay(oval);
			}
			//地图事件设置函数：
			function setMapEvent() {
				map.enableDragging(); //启用地图拖拽事件，默认启用(可不写)
				map.enableScrollWheelZoom(); //启用地图滚轮放大缩小
				map.enableDoubleClickZoom(); //启用鼠标双击放大，默认启用(可不写)
				map.enableKeyboard(); //启用键盘上下左右键移动地图
			}

			function createSearch(fn) {
				var map = window.map;
				var local = new BMap.LocalSearch(map, {
					renderOptions: {
						map: map,
						panel: "searchlist",
						onMarkersSet: function() {
							alert("sdf");
						},
						onResultsHtmlSet: function() {
							alert("dddd");
						}
					}
				});
			
				local.setInfoHtmlSetCallback(function(poi) {
					$("#searchlist li .qrdz").remove();
					$("#searchlist li").append("<span class='qrdz' style='float:right;padding: 10px,10px;background:#eeb818;display: inline-block;width:60px;height:30px;text-align: center;line-height: 30px;color:#fff;'>确认地址</span>");
					$("#searchlist li").on("click", ".qrdz", function() {
						
						var myGeo1 = new BMap.Geocoder();
						// 根据坐标得到地址描述    
						myGeo1.getLocation(poi.point, function(result) {
							if(result) {
								
								var addComp = result.addressComponents;
								mapAddress = addComp.province + addComp.city + addComp.district +
									addComp.street + addComp.streetNumber;
								fn();
							}
						})
						
						
					})
				});
				window.local = local;
			}
			//搜索
			function searchPlace(value) {
				window.local.search(value);
			}

			function createAutocomlete() {
				var map = window.map;
				var ac = new BMap.Autocomplete( //建立一个自动完成的对象
					{
						"input": "searchplace",
						"location": map
					});
				ac.addEventListener("onconfirm", function(e) { //鼠标点击下拉列表后的事件
					var _value = e.item.value;
					var addr = _value.business + _value.province + _value.city + _value.district + _value.street + _value.streetNumber;
					searchPlace(addr);

				});
			}

			function add_oval(centre, x, y) {
				var assemble = new Array();
				var angle;
				var dot;
				var tangent = x / y;
				for(i = 0; i < 36; i++) {
					angle = (2 * Math.PI / 36) * i;
					dot = new BMap.Point(centre.lng + Math.sin(angle) * y * tangent, centre.lat + Math.cos(angle) * y);
					assemble.push(dot);
				}
				return assemble;
			}
		
				
				/*	createMap();
				setMapEvent();
				createSearch();
				createAutocomlete();
				$("#s_p_search_btn").click(function() {
					searchPlace($("#searchplace").val());
				})
				var geoc = new BMap.Geocoder();
				map.addEventListener("click", function(e) {
					if(!e.overlay) {
						alert("此位置已超出上门送取范围，请选择蓝色区域内地点，或选择到店取还前往附近门店。")
					} else {
						var pt = e.point;
						geoc.getLocation(pt, function(rs) {
							var addComp = rs.addressComponents;
							alert(addComp.province + ", " + addComp.city + ", " + addComp.district + ", " + addComp.street + ", " + addComp.streetNumber);
							alert(addComp.province + ", " + addComp.city + ", " + addComp.district + ", " + addComp.street + ", " + addComp.streetNumber);
						});
					}
				})*/
				
			var XBSMap={
				createXBSMap:function(fn){
					var _this=this;
				createMap();
				setMapEvent();
				createSearch(fn);
				createAutocomlete();
				$("#s_p_search_btn").click(function() {
					searchPlace($("#searchplace").val());
				})
				var geoc = new BMap.Geocoder();
				map.addEventListener("click", function(e) {
					if(!e.overlay) {
						alert("此位置已超出上门送取范围，请选择蓝色区域内地点，或选择到店取还前往附近门店。")
					} else {
						var pt = e.point;
						geoc.getLocation(pt, function(rs) {
							var addComp = rs.addressComponents;
							alert(addComp.province + ", " + addComp.city + ", " + addComp.district + ", " + addComp.street + ", " + addComp.streetNumber);
							alert(addComp.province + ", " + addComp.city + ", " + addComp.district + ", " + addComp.street + ", " + addComp.streetNumber);
						});
					}
				})

				},
				address:""
			}